public  class Cbl_OrderItemPrice {
	
	public static void OrderItemPrice(List<Order_Product__c> list_oi)
	{
		set<string> set_str=new set<string>();
		for(Order_Product__c op:list_oi)
		{
			if(op.Company__c!=null)
			{
				set_str.add(op.Name+op.Company__c);
			}
		}
		Map<String,Price__c> map_sp=new Map<String,Price__c>();
		List<Price__c> list_sp=[select id,Priname__c,MarketPrice__c from Price__c where Priname__c in:set_str];
		for(Price__c p:list_sp)
		{
			map_sp.put(p.Priname__c,p);
		}
		
		for(Order_Product__c opNew:list_oi)
		{
			if(map_sp.containsKey(opNew.Name+opNew.Company__c))
			{
				opNew.Original_Price__c=map_sp.get(opNew.Name+opNew.Company__c).MarketPrice__c;
			}
		}
	}

}